import { defineStore } from 'pinia'

export const useHome = defineStore('useHome', {
  state: () => ({
    isLogin:false,
    stageList:{},
  }),
  //持久化配置
  persist: {
    //开启局部缓存
    enabled: true,
    strategies: [
      {
        key: 'useHome',
        storage: localStorage,
        paths:['isLogin','stageList']
      }
    ]
  },
  actions:{
    setIsLogin(avatarImg){
      this.isLogin=avatarImg
    },
    setStageList(data){
      this.stageList=data
    }
  }
},)